package com.seata.demo.order.service;

import io.seata.rm.tcc.api.BusinessActionContext;
//import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

import java.math.BigDecimal;

//@LocalTCC
public interface TccOrderService {

    @TwoPhaseBusinessAction(name = "createOrderTcc", commitMethod = "confirm", rollbackMethod = "cancel")
    void createOrder(String userId, String commodityCode, Integer count, BigDecimal money);

    boolean confirm(BusinessActionContext context);

    boolean cancel(BusinessActionContext context);
}
